FROM alpine

# admin
USER root

RUN apk update &&\
    # apk upgrade --no-progress &&\ # desnecessario
    apk add --no-progress nodejs

# create user app
RUN adduser -D -h /home/app -s /bin/false app app

# work directory
ENV HOME=/home/app

# work directory setting
WORKDIR $HOME

# API : npm install
RUN npm install --silent --progress=false

# API : Cunstom - cli
RUN npm install --global --progress=false --silent nodemon &&\
    npm install --global --progress=false --silent babel-cli &&\
    npm install --global --progress=false --silent babel-preset-env

# user operations
USER app
# FINIshin
CMD ["npm", "run", "start"]
